﻿<!DOCTYPE html>
<html lang="zh-CN">
<head>
   <#include "../comm/header.ftl"/>
    <link href="${req.contextPath}/lib/ligerUI/skins/ligerui-icons.css" rel="stylesheet" type="text/css" />
    <link rel="stylesheet" href="${req.contextPath}/js/bootstrap/css/bootstrap.css" type="text/css" />
    <script src="/js/plugins/My97DatePicker/WdatePicker.js"></script>
    <script>
        var grid = null;//表格对象
        $(function () {
            //grid
            grid = $("#customer_trace_history_msg").ligerGrid({
                height: '100%',
                heightDiff: -5,
                root:'list',
                record:'total',
                pageParmName:'currentPage',
                pagesizeParmName:'pageSize',
                dataAction: 'server',
                url: '/customerTraceHistory/getCustomerTraceHistoryData.do',
                checkbox:true,
                rownumbers:true,
                columns: [
                    {display: 'id', name: 'id',hide:true},
                    {display: '客户姓名', name: 'customer.name'},
                    {display: '跟进时间', name: 'traceTime'},
                    {display: '跟进记录', name: 'remark'},
                    {display: '跟进方式', name: 'traceType.title'},
                    {display: '跟进效果', name: 'traceResultName'},
                    {display: '录入人', name: 'inputUser.name'}
                ],
                toolbar: {
                    items: [
                        { text: '修改', click: '', icon: 'modify' },
                        { line: true },
                        { text: '删除', click: '', icon: 'delete' }
                    ]
                }
            });

            //高级查询
            $("#btn_query").click(function() {
                var keyword = $("#keyword").val();
                var beginDate = $("#beginDate").val();
                var endDate = $("#endDate").val();
                grid.set({
                    url: '/customerTraceHistory/getCustomerTraceHistoryData.do',
                    //以下设置字段名，为了跟PageInfo的字段名相同才能实现分页
                    root:'list',
                    record:'total',
                    pageParmName:'currentPage',
                    pagesizeParmName:'pageSize',
                    dataAction: 'server',
                    //这样提交高级查询参数
                    parms: {keyword:keyword,beginDate:beginDate,endDate:endDate}

                });
            });
            // 日历插件
            $("#beginDate").click(function () {
                WdatePicker({
                    readOnly: true, //只读
                    maxDate: new Date() //最多选到今天
                });
            });
            //endDate点击事件
            $("#endDate").click(function () {
                WdatePicker({
                    readOnly: true, //只读
                    minDate: $("#beginDate").val(),
                    maxDate: new Date() //最多选到今天
                });
            });

        });

    </script>
</head>
<body style="overflow-x:hidden; padding:2px;">
    <#--可以写一些表头的内容-->
    <div id="query_div">
        <!--高级查询--->
        <form class="form-inline" id="searchForm">
            <#--<input type="hidden" name="currentPage" id="currentPage" value="1">-->
            <#--<input type="hidden" name="pageSize" id="pageSize" value="20">-->
            <div class="form-group">
                <label>关键字:</label>
                <input type="text" class="form-control input-xs" name="keyword" id="keyword"
                       placeholder="请输入姓名/电话">
            </div>
            <div class="form-group">
                <label>时间:</label>
                <input type="text" class="form-control input-xs" id="beginDate" name="beginDate" placeholder="请输入开始时间"> ~
                <input type="text" class="form-control input-xs" id="endDate" name="endDate" placeholder="请输入结束时间">
            </div>
            <button type="button" id="btn_query" class="btn btn-info btn-sm">
                <span class="glyphicon glyphicon-search"></span> 查询
            </button>
        </form>
    </div>
    <div id="customer_trace_history_msg">
        <#--这里是数据表格-->
    </div>

</body>
</html>